package components.map.item
{
	import components.map.item.attribute.SceneItemAttribute;
	
	import flash.display.Sprite;
	import flash.events.MouseEvent;
	
	public class SceneItem extends Sprite
	{
		protected var _attribute:SceneItemAttribute;
		
		public function SceneItem()
		{
			super();
			init();
		}
		
		private function init():void
		{
			_attribute = new SceneItemAttribute();
			this.cacheAsBitmap = true;
			this.addEventListener( MouseEvent.MOUSE_DOWN, onMouseDown, false, 1000, true );
		}
		
		public function destroy():void
		{
			this.removeEventListener( MouseEvent.MOUSE_DOWN, onMouseDown );
		}
		
		public function clone():SceneItem
		{
			return null;
		}
		
		public function get attribute():SceneItemAttribute
		{
			return _attribute;
		}
		
		public function setLocation( x:int, y:int ):void
		{
			this.x = x;
			this.y = y;
		}
		
		protected function onMouseDown( e:MouseEvent ):void
		{
			e.stopImmediatePropagation();
		}
	}
}